<?php
       class portalshelf extends template{
           private $db;
           private $info;
           
           function __construct($db,$info)
           { 
             $this->db=$db;   
             $this->info=$info;
             $this->db->get_connect();
           }
           function getshelf()
           {
            $where="";
            if($_GET['searchText'])
            {
            $where=" where tb_shelf.title like '%".$_GET['searchText']."%' or tb_shelf.descritpion like '%".$_GET['searchText']."%' ";
            
            }
            $sql="SELECT
            tb_shelf.shelfid,
            tb_shelf.title,
            tb_shelf.descritpion,
             DATE_FORMAT(tb_shelf.createdate,'%d/%m/%Y') as createdate ,
            tb_shelf.photo
            FROM
            tb_shelf   
            $where
            ";
            //echo $sql;
//            exit;
            $arrayshelf=$this->db->db_set_recordset($sql);
            $this->db->closedb(); 
            
            return      $arrayshelf;
              
           }
           function view(){ 
           
             $data['arrayshelf']=$this->getshelf();
             $this->setdata($data);
             $this->load('portalshelf');
           
           }
           
           
           function __destruct() 
           { 
            
           }
        
        
        }
?>
